<!-- 头部标题 -->
<template>
  <div>
    <!-- 头部标题 -->
    <van-nav-bar :title="topTitle" fixed>
      <div slot="left" @click="goBack" v-show="!this.toPath.includes($route.path)">
        <van-icon name="arrow-left" />
      </div>
      <div slot="right" @click="goto('/setting')" v-show="$route.path =='/userIndex'">
        <van-icon name="setting" />
      </div>
      <div slot="right" v-show="$route.path =='/projectDetail'">
        <van-icon name="weapp-nav" @click="show = true" />
      </div>
    </van-nav-bar>
    <van-action-sheet v-model="show" title="微信好友或朋友圈分享">
      <div class="van_action">
        <van-row>
          <van-col span="12" class="tac">微信好友分享</van-col>
          <van-col span="12" class="tac">微信朋友圈</van-col>
        </van-row>
      </div>
    </van-action-sheet>
  </div>
</template>
<style scoped>
.van-hairline--bottom::after {
  border-bottom-width: 0px !important;
}
.van_action {
  height: 3rem;
  padding: 0.3rem;
  box-sizing: border-box;
  line-height: 3rem;
}
</style>
<script>
export default {
  props: ['topTitle'],
  data () {
    return {
      show: false,
      toPath: ['/', '/index', '/userIndex', '/articleList']
    }
  },
  methods: {
    goBack () {
      this.$router.go(-1)
    },
    goto (path) {
      this.$router.push(path)
    }
  }
}
</script>